<template>
    <!-- 管理收获地址 -->
    <div class="address">
        <van-address-list v-model="chosenAddressId" :list="addressList" 
            @add="onAdd" @edit="onEdit" />
        <!--
            @edit="onEdit" -->
    </div>
</template>

<script>
export default {
    data() {
        return {
            chosenAddressId: 2,
            addressList: [
                {
                    id: 1,
                    name: "张三",
                    tel: "110",
                    address: "成都市九里堤西路2号",
                    isDefault: true,
                },
                {
                    id: 2,
                    name: "李四",
                    tel: "120",
                    address: "成都市九里堤西路2号",
                    isDefault: false,
                },
            ],
        };
    },
    methods:{
        onAdd(){
            alert('点击了添加按钮')
        },
        onEdit(item,index){
            console.log(item,index)
            alert('你点击修改图标')
        }
    }
};
</script>
